home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 7
/
FM Towns Free Software Collection 7.iso
/
taropyon
/
hewin
/
ccisrc
/
debug.cci
< prev
next >
Wrap
Text File
|
1993-11-30
|
5KB
|
239 lines
/*************************************************************************
* "debug.cci"
*************************************************************************/
#ifdef _TAROPYON_SYSTEM
int CCI_dspCciStatus()
{
char *dlg;
int ch, x, y;
UINT ec;
dlg = DLG_msgOpen(DLGPOS_MOS_SET_CENTER,DLGPOS_MOS_SET_CENTER,
8*32,16*12, C_MBLACK, C_DLGBASE, COLMIX(C_INFO,C_GRAY),
"CCI STATUS");
if ( dlg == NULL )
return (ERR);
DLG_msgClear( dlg, C_HWHITE );
DLG_msgPrintf(dlg, " _heep_max = %8d\r\n", _heep_max );
DLG_msgPrintf(dlg, " _code_max = %8d\r\n", _code_max );
DLG_msgPrintf(dlg, "\r\n" );
DLG_msgPrintf(dlg, " _heep_pos = %8d\r\n", _heep_pos );
DLG_msgPrintf(dlg, " _base_pos = %8d\r\n", _base_pos );
DLG_msgPrintf(dlg, " _stak_pos = %8d\r\n", _stak_pos );
DLG_msgPrintf(dlg, " _code_pos = %8d\r\n", _code_pos );
DLG_msgPrintf(dlg, " _symb_pos = %8d\r\n", _symb_pos );
DLG_msgPrintf(dlg, "\r\n" );
while ( 1 )
{
ch = EVT_getkey(&ec);
if ( ch != 0xFFFF || EVT_mos_pget(&x,&y) )
break;
EVT_idl();
}
DLG_msgClose(dlg);
EVT_mos_waitBO();
return (NORMAL);
}
#endif
#ifdef _TAROPYON_SYSTEM
int CCI_printPcbDta()
{
unsigned int adr;
adr = PcbDta;
DLG_tmpMsgBox( DLGPOS_MOS_SET_CENTER, DLGPOS_MOS_SET_CENTER,
C_MBLACK, C_DLGBASE, COLMIX(C_INFO,C_GRAY),
" PCB DTA ADDRESS $%08X ", adr );
return (NORMAL);
}
#endif
/*************************************************************************
* 子プロセスの実行
*************************************************************************/
int CCI_pclExec(int argc, char **argv)
{
int ret;
char *fdl;
char *fn;
char tmp[128];
if ( argc > 1 )
{
sprintf( tmp, "%s.", AplGetStartPath() );
FS_chdrv( toupper(tmp[0]) - 'A' );
FS_chdir( tmp );
fn = argv[1];
ret = NORMAL;
} else
{
if ( (fdl = FDL_open(0)) == NULL )
return (ERR);
FDL_set_title( fdl, "CHILD PROCESS LOADER");
FDL_set_wildcard( fdl, "*.exp");
if ( FDL_start(fdl) == NORMAL && FS_setFullPathname( tmp, FDL_get_filename(fdl)) == NORMAL )
{
ret = NORMAL;
fn = tmp;
} else
ret = ERR;
FDL_close(fdl);
}
if ( ret == NORMAL )
{
AplDtaInit();
DTA_dump( "f:/tmp/dta001.dmp" );
ret = AplPclExec( fn, 3 );
DTA_dump( "f:/tmp/dta002.dmp" );
}
return (ret);
}
/*************************************************************************
* ネイティブ子プロセスのリンク
*************************************************************************/
int CCI_pclLink(int argc, char **argv)
{
int ret;
char *fdl;
char *fn;
char tmp[128];
UINT siz;
siz = 0;
if ( argc > 1 )
{
sprintf( tmp, "%s.", AplGetStartPath() );
FS_chdrv( toupper(tmp[0]) - 'A' );
FS_chdir( tmp );
fn = argv[1];
if ( argc > 2 )
siz = atoi(argv[2]) * 1024;
ret = NORMAL;
} else
{
if ( (fdl = FDL_open(0)) == NULL )
return (ERR);
FDL_set_title( fdl, "CHILD PROCESS LOADER");
FDL_set_wildcard( fdl, "*.exp");
if ( FDL_start(fdl) == NORMAL && FS_setFullPathname( tmp, FDL_get_filename(fdl)) == NORMAL )
{
ret = NORMAL;
fn = tmp;
} else
ret = ERR;
FDL_close(fdl);
}
if ( ret == NORMAL )
{
if ( siz ==0 )
siz = 1*1024*1024; /* 1M */
ret = AplPclLink( fn, siz );
}
return (ret);
}
#ifdef _CCISRC_EXTRACT
/*************************************************************************
* CCI プログラムのソースリストを解凍する
*************************************************************************/
int CCI_extractHewinCci()
{
int drv, i, j;
char dir[128], path[128], buf[128];
char *fp;
sprintf( dir, "%s%s", AplGetStartPath(), "ccisrc");
drv = toupper(dir[0]) - 'A';
FS_chdrv( drv );
FS_chdir( dir );
sprintf( path,"%s%s", dir, "\\hewincci.exe");
if ( (fp = FM_fopen(path,"r")) == NULL )
{
DLG_tmpMsgTime( DLGPOS_MOS_SET_CENTER, DLGPOS_MOS_SET_CENTER,
C_MBLACK, C_DLGBASE, COLMIX(C_ERROR,C_GRAY),
4, "HEWINCCI.EXE : がありません。" );
return (ERR);
}
FM_fclose(fp);
sprintf( buf, "\\k%04X%c:\\rcd ", KA_PF2|KA_BIT_CTRL, drv + 'A' );
i = strlen(buf);
j = 0;
while ( dir[j] )
{ if ( dir[j] == '\\' )
{ buf[i] = '\\'; ++i;
buf[i] = 'x'; ++i;
buf[i] = '5'; ++i;
buf[i] = 'c'; ++i;
++j;
} else
{ buf[i] = dir[j]; ++i;
++j;
}
}
strcpy( buf + i, "\\rhewincci\\r");
SendKeyBoardLog( buf );
PlayKeyBoardLog();
return (ERR);
}
#endif
/*************************************************************************
* アイドリング処理の一覧を表示(デバッグ用)
*************************************************************************/
int CCI_idlFuncList()
{
AplIdlingFuncList();
return (NORMAL);
}
#if 0
#ifdef _TAROPYON_SYSTEM
int CCI_checkMaxAlloc()
{
unsigned int siz;
char *ptr;
char tmp[64];
siz = 8 * 1024 * 1024;
do
{
if ( (ptr = malloc(siz)) == NULL )
{
if ( siz < 256 )
break;
if ( siz > 4 * 1024 * 1024 )
siz -= 1024 * 1024;
else if ( siz > 2 * 1024 * 1024 )
siz -= 64 * 1024;
else if ( siz > 1024 * 1024 )
siz -= 4 * 1024;
}
} while ( ptr == NULL );
if ( ptr )
free(ptr);
else
siz = 0;
DLG_tmpMsgBox( DLGPOS_MOS_SET_CENTER, DLGPOS_MOS_SET_CENTER,
C_MBLACK, C_DLGBASE, COLMIX(C_INFO,C_GRAY),
" Max alloc size %s byte(s) ", GetSizeStr(siz,tmp) );
return (NORMAL);
}
#endif
#endif